package lab02.test34;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Test34 {
    public static void main(String[] args) {
        List<String>list = new ArrayList<String>();
        list.add("apple");
        list.add("grape");
        list.add("banana");
        list.add("pear");

        Object[] s = list.toArray();

        String a = Collections.max(list);
        String b = Collections.min(list);
        System.out.println("最小的数是："+b);
        System.out.println("最大的数是："+a);

        System.out.println("最小的数："+s[0]);
        System.out.println("最大的数："+s[s.length-1]);
        for (Object o:s){
            System.out.println(o);
        }
    }
}
